package edu.sctu.wulixia.month6.day20150608;

/**
 * Created by user05 on 2015/6/8.
 */
//用Thread模拟卖票

public class TicketNumber2 extends Thread{
    int ticketNumber = 5;//票数总为五张
    String name;

    public TicketNumber2(String name){
        this.name = name;
    }

    @Override
    public void run() {

        while(ticketNumber > 0){
            ticketNumber--;//剩余票数

            System.out.println(name+ "卖出1张票，剩余票数为：" + ticketNumber);
        }
    }
}
